FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /app

# copy csproj and restore as distinct layers
COPY . .
RUN dotnet restore
RUN dotnet publish -c Release -o out


FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS runtime
WORKDIR /app
COPY --from=build /app/out ./
# 解决访问不到sslv1
RUN sed -e '/\[system_default_sect\]/d;/MinProtocol = TLSv1.2/d;/CipherString = DEFAULT@SECLEVEL=2/d' /etc/ssl/openssl.cnf > /etc/ssl/openssl.cnf

EXPOSE 5005

ENTRYPOINT ["dotnet", "EduCMS.dll"]
##